const express = require('express');
const _ = require('lodash');
const moment = require('moment');

const app = express();
const port = process.env.PORT || 3000;

app.get('/', (req, res) => {
  const data = {
    message: 'Hello from Node.js Cache Demo!',
    timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
    randomNumbers: _.times(5, () => _.random(1, 100))
  };
  
  res.json(data);
});

app.listen(port, () => {
  console.log(`Server running at http://localhost:${port}`);
});